#ifndef __EVENT_H
#define __EVENT_H

#include <SDL/SDL.h>

/**
  * Class where all its components are visible. This class describes that is a
  * generic event. It defines some type of variable like the kind of
  * peripherals, the components and the actions. A generic event it's only
  * a action happened in a components in the peripheral number n.
  */
struct Event
{
  /**
    * At the momento only keyboard, mouse and joysticks are supported.
    */
  typedef enum
  {
    KEYBOARD,
    MOUSE,
    JOYSTICK
  }peripheral_t;

  /** This represent a component in a peripheral like a button or key */
  typedef int component_t;

  /** The kind of the actions are supported */
  typedef enum
  {
    NO_EVENT=-1,
    ON_PRESS,
    ON_PRESSING,
    ON_RELEASE,
    ON_RELEASING
  }action_t;

  /** Empty */
  Event();
  /** Initialize all the variables */
  Event(peripheral_t p,component_t c,action_t a=ON_PRESS,Uint8 number=0);

  /** @returns if the event is the same to @param e */
  bool operator==(const Event &e);
  /** @returns if the event is different to @param e */
  bool operator!=(const Event &e);

  peripheral_t peripheral;
  component_t component;
  action_t action;
  Uint8 device_number;
};

#endif
